package com.syn.michat.mapper;

import com.syn.michat.pojo.Friend;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface FriendsMapper {

    public int request(Friend friend);

    public List<Friend> quaryAllFriendRequest(String userId, int status);

    public List<Friend> quaryAllFriends(String userId, int status);

    public void updateFriendStatus(String userId, String friendId, int status);

    @Select("select * from t_friends where user_id = #{userId} and friend_id = #{friendId}")
    @ResultMap("result")
    public Friend findFriend(String userId, String friendId);

}
